<?php 
include("conn.php");
include('seguridad.php');
$pkuser=$_REQUEST["cedest"];;
$pro1=$_POST['deta1'];
$pro2=$_POST['deta2'];
$pro3=$_POST['deta3'];
$pro4=$_POST['deta4'];
$pro5=$_POST['deta5'];
$pro6=$_POST['deta6'];
$pro7=$_POST['deta7'];
$pro8=$_POST['deta8'];
$pro9=$_POST['deta9'];
/*$query ="delete from bt14situes where bt14ides='".$pkuser."'";
echo 'eliminado '.$mysqli->query($query);*/
foreach ($_REQUEST["seleccion"] as $value) {
if($value=='72'){	
	$query = "INSERT INTO `bt14situes`(`bt14cosi`,`bt14ides`,`bt14esta`,`bt14deta`)
				VALUES ('$value',
			      '$pkuser','checked','$pro1');";	
		}	
if($value=='73'){	
	$query = "INSERT INTO `bt14situes`(`bt14cosi`,`bt14ides`,`bt14esta`,`bt14deta`)
				VALUES ('$value',
			      '$pkuser','checked','$pro2');";	
		}
if($value=='74'){	
	$query = "INSERT INTO `bt14situes`(`bt14cosi`,`bt14ides`,`bt14esta`,`bt14deta`)
				VALUES ('$value',
			      '$pkuser','checked','$pro3');";	
		}	
if($value=='75'){	
	$query = "INSERT INTO `bt14situes`(`bt14cosi`,`bt14ides`,`bt14esta`,`bt14deta`)
				VALUES ('$value',
			      '$pkuser','checked','$pro4');";	
		}	
if($value=='76'){	
	$query = "INSERT INTO `bt14situes`(`bt14cosi`,`bt14ides`,`bt14esta`,`bt14deta`)
				VALUES ('$value',
			      '$pkuser','checked','$pro5');";	
		}	
if($value=='77'){	
	$query = "INSERT INTO `bt14situes`(`bt14cosi`,`bt14ides`,`bt14esta`,`bt14deta`)
				VALUES ('$value',
			      '$pkuser','checked','$pro6');";	
		}	
if($value=='78'){	
	$query = "INSERT INTO `bt14situes`(`bt14cosi`,`bt14ides`,`bt14esta`,`bt14deta`)
				VALUES ('$value',
			      '$pkuser','checked','$pro7');";	
		}	
if($value=='79'){	
	$query = "INSERT INTO `bt14situes`(`bt14cosi`,`bt14ides`,`bt14esta`,`bt14deta`)
				VALUES ('$value',
			      '$pkuser','checked','$pro8');";	
		}	
if($value=='80'){	
	$query = "INSERT INTO `bt14situes`(`bt14cosi`,`bt14ides`,`bt14esta`,`bt14deta`)
				VALUES ('$value',
			      '$pkuser','checked','$pro9');";	
		}	
}
echo $mysqli->query($query);
}
print "<script>alert('Se inserto con exito');</script>";
print "<script>window.open('../Usuarios/index.php', '_self');</script>";
header('Location: ../Formularios/GridFormularios.php'); 
?>
